import React, {Component, Fragment} from 'react';
import Panel from "./components/Panel";
import Info from "./components/Info";
import Details from "./components/Details";
import Teacher from "./components/Teacher";
import Hotel from "./components/Hotel";
import {connect} from "react-redux";
import {actionCreators} from "./store/index";


class Home extends Component {
    render() {
        return (
            <Fragment>
                <Panel/>
                <Info/>
                <Details/>
                <Teacher/>
                <Hotel/>
            </Fragment>
        )
    }
    // 挂载后执行
    componentDidMount() {
        this.props.changePanelData();
    }
}
const mapDispatch = (dispatch) => ({
    changePanelData() {
        const action = actionCreators.getPanel();
        dispatch(action);
    }
});
export default connect(null, mapDispatch)(Home);
